{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 模拟梯度下降法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-1.  , -0.95, -0.9 , -0.85, -0.8 , -0.75, -0.7 , -0.65, -0.6 ,\n",
       "       -0.55, -0.5 , -0.45, -0.4 , -0.35, -0.3 , -0.25, -0.2 , -0.15,\n",
       "       -0.1 , -0.05,  0.  ,  0.05,  0.1 ,  0.15,  0.2 ,  0.25,  0.3 ,\n",
       "        0.35,  0.4 ,  0.45,  0.5 ,  0.55,  0.6 ,  0.65,  0.7 ,  0.75,\n",
       "        0.8 ,  0.85,  0.9 ,  0.95,  1.  ,  1.05,  1.1 ,  1.15,  1.2 ,\n",
       "        1.25,  1.3 ,  1.35,  1.4 ,  1.45,  1.5 ,  1.55,  1.6 ,  1.65,\n",
       "        1.7 ,  1.75,  1.8 ,  1.85,  1.9 ,  1.95,  2.  ,  2.05,  2.1 ,\n",
       "        2.15,  2.2 ,  2.25,  2.3 ,  2.35,  2.4 ,  2.45,  2.5 ,  2.55,\n",
       "        2.6 ,  2.65,  2.7 ,  2.75,  2.8 ,  2.85,  2.9 ,  2.95,  3.  ,\n",
       "        3.05,  3.1 ,  3.15,  3.2 ,  3.25,  3.3 ,  3.35,  3.4 ,  3.45,\n",
       "        3.5 ,  3.55,  3.6 ,  3.65,  3.7 ,  3.75,  3.8 ,  3.85,  3.9 ,\n",
       "        3.95,  4.  ,  4.05,  4.1 ,  4.15,  4.2 ,  4.25,  4.3 ,  4.35,\n",
       "        4.4 ,  4.45,  4.5 ,  4.55,  4.6 ,  4.65,  4.7 ,  4.75,  4.8 ,\n",
       "        4.85,  4.9 ,  4.95,  5.  ,  5.05,  5.1 ,  5.15,  5.2 ,  5.25,\n",
       "        5.3 ,  5.35,  5.4 ,  5.45,  5.5 ,  5.55,  5.6 ,  5.65,  5.7 ,\n",
       "        5.75,  5.8 ,  5.85,  5.9 ,  5.95,  6.  ])"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "plot_x = np.linspace(-1., 6., 141)\n",
    "plot_x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "plot_y = (plot_x-2.5)**2 - 1."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8leXdx/HPL3uRhAwC2WETlkAII+LEgYADFyhqnW3V\np9a2tvXpo63tq9Y+dthhVcSBoqBS1DoBFWWPsEeADBKSEMiADLKTcz1/JPZBCwmQk9znPuf3fr14\nkcRj7q8xfLly3dd9XWKMQSmllP15WR1AKaWUc2ihK6WUm9BCV0opN6GFrpRSbkILXSml3IQWulJK\nuQktdKWUchNa6Eop5Sa00JVSyk349OTFoqKiTHJyck9eUimlbG/Lli3lxpjozl7Xo4WenJxMZmZm\nT15SKaVsT0QKzuR1OuWilFJuQgtdKaXchBa6Ukq5CS10pZRyE1roSinlJrTQlVLKTWihK6WUm7BF\noa/OLuMfX+ZYHUMppc5aXVMLT3ywh4KK2m6/li0KfU12OX9afoDSmgaroyil1Fn5cGcJr6zNp7Sm\nsduvZYtCv2l8Ai0Ow5ItRVZHUUqps7J40yEGRAeTltS7269li0IfEB1CekoEb20uxBhjdRyllDoj\nB47WsPVQJbPHJyIi3X49WxQ6wJz0BAoq6lifV2F1FKWUOiOLNxXi6y3MGhvXI9ezTaFPG9GP0AAf\nFm8qtDqKU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m4FBIpIiIn7AbOBfFmdyCyIitM1DZhlj/mR1ns6ISLSIhLe/HQhcBuyzNtWpGWMeNcbEG2OSafue\n/cKVy1xEgkWk19dvA5fjmn9RYow5AhSKyJD2D10K7O2u69mq0EXkOhEpAiYBH4nIMqszncwY0wI8\nCCyj7abd28aYPdamOj0RWQSsB4aISJGI3G11pg5kALcBl7QvVdvePqJ0Vf2AlSKyk7a/6FcYY1x+\nOaBNxABrRGQHsAn4yBjzqcWZOvJfwBvt3wvnAU9214X0SVGllHITthqhK6WUOj0tdKWUchNa6Eop\n5Sa00JVSyk1ooSullJvQQldKKTehha6UUm5CC10ppdzE/wEPCnAhTpWsaQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10c734b00>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(plot_x, plot_y)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "epsilon = 1e-8\n",
    "eta = 0.1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2.499891109642585\n",
      "-0.99999998814289\n"
     ]
    }
   ],
   "source": [
    "def J(theta):\n",
    "    return (theta-2.5)**2 - 1.\n",
    "\n",
    "def dJ(theta):\n",
    "    return 2*(theta-2.5)\n",
    "\n",
    "theta = 0.0\n",
    "while True:\n",
    "    gradient = dJ(theta)\n",
    "    last_theta = theta\n",
    "    theta = theta - eta * gradient\n",
    "    \n",
    "    if(abs(J(theta) - J(last_theta)) < epsilon):\n",
    "        break\n",
    "    \n",
    "print(theta)\n",
    "print(J(theta))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAAB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l0E5E0kVkvNWZqjEAGAdcXrVU\nbWPViNJVNQMWi8hmKv+iX2iMcfnlgDbRBFgmIpuANcBXxpj/WpypOr8FPqj6XugO/K2uLqRPiiql\nlJuw1QhdKaXUuWmhK6WUm9BCV0opN6GFrpRSbkILXSml3IQWulJKuQktdKWUchNa6Eop5Sb+P8u/\nPqhgwi92AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10c9c6e48>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "theta = 0.0\n",
    "theta_history = [theta]\n",
    "while True:\n",
    "    gradient = dJ(theta)\n",
    "    last_theta = theta\n",
    "    theta = theta - eta * gradient\n",
    "    theta_history.append(theta)\n",
    "    \n",
    "    if(abs(J(theta) - J(last_theta)) < epsilon):\n",
    "        break\n",
    "\n",
    "plt.plot(plot_x, J(plot_x))\n",
    "plt.plot(np.array(theta_history), J(np.array(theta_history)), color=\"r\", marker='+')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "46"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(theta_history)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "theta_history = []\n",
    "\n",
    "def gradient_descent(initial_theta, eta, epsilon=1e-8):\n",
    "    theta = initial_theta\n",
    "    theta_history.append(initial_theta)\n",
    "\n",
    "    while True:\n",
    "        gradient = dJ(theta)\n",
    "        last_theta = theta\n",
    "        theta = theta - eta * gradient\n",
    "        theta_history.append(theta)\n",
    "    \n",
    "        if(abs(J(theta) - J(last_theta)) < epsilon):\n",
    "            break\n",
    "            \n",
    "def plot_theta_history():\n",
    "    plt.plot(plot_x, J(plot_x))\n",
    "    plt.plot(np.array(theta_history), J(np.array(theta_history)), color=\"r\", marker='+')\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl4VdW9//H3N3OYwhSGEEiYkUFEIoM4gPNsa1tFxbbW\nob3ae6u/Dk9722q04328nW5rrWidB2ytHdS2jkzKGCZlHkIgYUoIJISEQJKzfn/kBBAhITknZ599\nzuf1PHnI2RyyPwb4sFx77bXNOYeIiPhfgtcBREQkPFToIiIxQoUuIhIjVOgiIjFChS4iEiNU6CIi\nMUKFLiISI1ToIiIxQoUuIhIjkiJ5sp49e7rc3NxInlJExPeWLVu21zmX2dL7Ilroubm5FBQURPKU\nIiK+Z2bbTud9mnIREYkRKnQRkRihQhcRiREqdBGRGKFCFxGJESp0EZEYoUIXEYkRvij0+ZvK+P2c\nzV7HEBFptZoj9Tz0+hq2lVe3+7l8UegfbNrLL9/eSGlVrddRRERa5Y2PdvH0h0WUVh1u93P5otBv\nPKc/9QHHq8tKvI4iItIqs5ZsZ3BmR/JyurX7uXxR6IMzOzFhYHdeWVqMc87rOCIip2XjniqWb69g\n+jkDMLN2P58vCh3g5gn92VZew8LCcq+jiIiclllLiklONG44u19EzuebQr9ydF+6pCUxa0mx11FE\nRFpUW9fAaytKuGxkH3p0So3IOX1T6GnJiXx2XD/+vXo3+6uPeB1HRKRZb6/dQ0VNHdMn9I/YOX1T\n6ADTJwzgSEOAv67Y4XUUEZFmzVqynexu6UwZ3DNi5/RVoZ/Rtwtj+3dl1tLtujgqIlFrW3k1C7aU\nc1NefxIS2v9iaBNfFTrA9HP6s3HPQZZvr/A6iojISc1aWkyCwRfyIjfdAj4s9GvHZtEhJZFXlm73\nOoqIyKfUNQR4dVkJF43oRZ+MtIie23eF3ik1ievGZvH6ql1U1dZ5HUdE5BPeX19KWdVhbjpn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3jSzt7zOdDznXD3wdeAtGi/a/ck5t8bbVKdmZi8D\nC4HhZlZiZnd4nakZU4DbgIuCS9VWBkeU0aovMNvMPqLxH/p3nHNRvxzQJ3oDH5jZKmAJ8KZz7t8e\nZ2rOfwIvBv8snAX8tL1OpDtFRURihK9G6CIicmoqdBGRGKFCFxGJESp0EZEYoUIXEYkRKnQRkRih\nQhcRiREqdBGRGPH/AQvhHj7AkBH7AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10cb767b8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "eta = 0.01\n",
    "theta_history = []\n",
    "gradient_descent(0, eta)\n",
    "plot_theta_history()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "424"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(theta_history)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl4leWd//H3NythC1tYAyTsIohoZBER3MW9tiooWq1L\nZ9SZ6q+1v3bmNxXba9rOZRedjrVF64qKS+ni0ioo+x42ZV9CQsKWEEgIS0KSc//+SOggJieBc3Ke\n85zzeV0XF+TkkOfTVD7c3M/93Lc55xAREf9L8DqAiIiEhwpdRCRGqNBFRGKECl1EJEao0EVEYoQK\nXUQkRqjQRURihApdRCRGqNBFRGJEUiQv1qVLF5eVlRXJS4qI+N6qVasOOOcymnpfRAs9KyuL3Nzc\nSF5SRMT3zKygOe/TlIuISIxQoYuIxAgVuohIjFChi4jECBW6iEiMUKGLiMQIFbqISIzwRaEv3FbC\nb+dt9zqGiMgZO3aihqfe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woXPu7x5nCuZfgDfq/1s4H/hpS11IT4qKiMQIX43QRUSkcSp0EZEY\noUIXEYkRKnQRkRihQhcRiREqdBGRGKFCFxGJESp0EZEY8f8BU8VcmTG+cWEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10cb1ecc0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "eta = 0.001\n",
    "theta_history = []\n",
    "gradient_descent(0, eta)\n",
    "plot_theta_history()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3682"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(theta_history)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xdc1uX+x/HXxQYZiiAoU3Ar4kAFTcvS1DRLW5pa2bBO\ndTpZp3U6ldVpnNM51alfy4aZliOzvbSyNDe4FRVFEBBkuNgyrt8fXzyOFFBu7u89Ps/Hw4eMW77v\nTD9cXuNzKa01Qggh7J+L2QGEEEJYhhR0IYRwEFLQhRDCQUhBF0IIByEFXQghHIQUdCGEcBBS0IUQ\nwkFIQRdCCAchBV0IIRyEmzUfFhQUpKOjo635SCGEsHspKSmFWuvghl5n1YIeHR1NcnKyNR8phBB2\nTymV2ZjXyZSLEEI4CCnoQgjhIKSgCyGEg5CCLoQQDkIKuhBCOAgp6EII4SCkoAshhIOwi4K+Iq2A\nN3/dY3YMIYQ4b2XHq3n66+1kFpU2+7PsoqD/nlbIy0t2k19cYXYUIYQ4L99syWXWygzyiyub/Vl2\nUdCv7xdBda1mUUq22VGEEOK8zF+3n9jgFiREtWr2Z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ftNZdgHia8ffYrgq61jpVa73L7Bz16A/s0Vqn\na62PA/OBq0zOdE5a6+XAIbNzNIbWOldrvaHu7WKMvxRh5qY6N20oqXvXve6HzS5YKaXCgdHAe2Zn\ncSRKqQBgCPA+gNb6uNb6SHM9z64Kuh0IA7JOeT8bGy469kopFQ30Btaam6R+dVMYm4B8YKnW2pbz\nvgo8DNSaHaSRNPCTUipFKTXN7DD1aA8UALPqprPeU0q1aK6H2VxBV0r9pJTadpYfNjvSFdajlPIF\nPgPu11ofMztPfbTWNVrrXkA40F8pZZN3SyulxgD5WusUs7Och4vqfm9HYUy/DTE70Dm4AX2At7TW\nvYFSoNnW1mzukmit9TCzMzRBDhBxyvvhdR8TFqCUcsco5h9rrRebnaextNZHlFLLMNYrbHEBehAw\nVil1BeAF+Cul5mqtJ5uc65y01jl1P+crpT7HmO60xbW1bCD7lH+dLaIZC7rNjdDt3Hqgo1KqvVLK\nA5gAfGVyJoeglFIY85CpWuuXzc7TEKVUsFKqZd3b3sBwYKe5qc5Oa/2Y1jpcax2N8Wf2F1su5kqp\nFkopvxNvA5djm98o0VrnAVlKqc51H7oM2NFcz7Orgq6UGqeUygaSgG+VUj+anelUWutq4F7gR4xF\nu4Va6+3mpjo3pdQ8YDXQWSmVrZS6zexM9RgETAEurduqtqluRGmr2gLLlFJbML7RL9Va2/x2QDsR\nAvyulNoMrAO+1Vr/YHKm+vwZ+Ljuz0Iv4PnmepCcFBVCCAdhVyN0IYQQ5yYFXQghHIQUdCGEcBBS\n0IUQwkFIQRdCCAchBV0IIRyEFHQhhHAQUtCFEMJB/D9wf/0sLmC5qwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10cd7dd30>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "eta = 0.8\n",
    "theta_history = []\n",
    "gradient_descent(0, eta)\n",
    "plot_theta_history()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "ename": "OverflowError",
     "evalue": "(34, 'Result too large')",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mOverflowError\u001b[0m                             Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-41-81ad09e9d3e0>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0meta\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m1.1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      2\u001b[0m \u001b[0mtheta_history\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mgradient_descent\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0meta\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;32m<ipython-input-35-37822183f4df>\u001b[0m in \u001b[0;36mgradient_descent\u001b[0;34m(initial_theta, eta, epsilon)\u001b[0m\n\u001b[1;32m     11\u001b[0m         \u001b[0mtheta_history\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtheta\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     12\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 13\u001b[0;31m         \u001b[0;32mif\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mabs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mJ\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtheta\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0mJ\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlast_theta\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m<\u001b[0m \u001b[0mepsilon\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     14\u001b[0m             \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     15\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m<ipython-input-32-e8b6a6f56c24>\u001b[0m in \u001b[0;36mJ\u001b[0;34m(theta)\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mJ\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtheta\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m     \u001b[0;32mreturn\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mtheta\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m2.5\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0;36m2\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0;36m1.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      4\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mdJ\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtheta\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      5\u001b[0m     \u001b[0;32mreturn\u001b[0m \u001b[0;36m2\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtheta\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m2.5\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mOverflowError\u001b[0m: (34, 'Result too large')"
     ]
    }
   ],
   "source": [
    "eta = 1.1\n",
    "theta_history = []\n",
    "gradient_descent(0, eta)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def J(theta):\n",
    "    try:\n",
    "        return (theta-2.5)**2 - 1.\n",
    "    except:\n",
    "        return float('inf')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def gradient_descent(initial_theta, eta, n_iters = 1e4, epsilon=1e-8):\n",
    "    \n",
    "    theta = initial_theta\n",
    "    i_iter = 0\n",
    "    theta_history.append(initial_theta)\n",
    "\n",
    "    while i_iter < n_iters:\n",
    "        gradient = dJ(theta)\n",
    "        last_theta = theta\n",
    "        theta = theta - eta * gradient\n",
    "        theta_history.append(theta)\n",
    "    \n",
    "        if(abs(J(theta) - J(last_theta)) < epsilon):\n",
    "            break\n",
    "            \n",
    "        i_iter += 1\n",
    "        \n",
    "    return"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "eta = 1.1\n",
    "theta_history = []\n",
    "gradient_descent(0, eta)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10001"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(theta_history)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlw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mbmrSlBPOBc+7dY3jZYaAl8PW88L6slO57NLNvAE9NcnEmS079\nTkbDOXc4/HjczJ7AN1O9nPpVOeOYmc1xznWZ2RzgeKYLNF7OuWOR51P5N6Ur+on3JPARMys1swXA\nYuA3GS7TmIT/uCLuwndA56LfAovNbIGZleA7y5/McJnGzczKzawy8hy4ldz9HSXzJHBv+Pm9wA8z\nWJYJkam/KV3Rj5GZ3QV8FWgEnjaz151ztznntpnZ48B2YBD4tHNuKJNlHYcvmdla/EfmA8CnMluc\nsXHODZrZZ4DngELgm865bRku1kRoAp4wM/B/y484557NbJHGxsweBW4AGszsELAJeBB43Mzux89u\ne0/mSjh6w7ynGzLxN6U7Y0VE8pyabkRE8pyCXkQkzynoRUTynIJeRCTPKehFRPKcgl5EJM8p6EVE\n8pyCXkQkz/1/CxE6FcrtP+EAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10cb310b8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "eta = 1.1\n",
    "theta_history = []\n",
    "gradient_descent(0, eta, n_iters=10)\n",
    "plot_theta_history()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
